import request from './http.request';

export default {
	//获取组织架构
	getDeptTree:(params) => {return request({url: '/admin/dept/user-tree',method: 'get',params: params})},
	//获取组织架构列表
	getDeptList:(data) => {return request({url: '/admin/dept/list',method: 'post',data: data})},
	//单个添加组织架构
	addDept:(data) => {return request({url: '/admin/dept',method: 'post',data: data})},
	//更新
	editDept:(data) => {return request({url: '/admin/dept',method: 'put',data: data})},
	//删除
	delDept:(id) => {return request({url: `/admin/dept/${id}`,method: 'delete'})},

	//项目列表
	getProjectList:(data) => {return request({url: '/dc/device/project_list',method: 'post',data: data})},
	//项目详情
	getProjectDetail:(id) => {return request({url: `/admin/project/details/${id}`,method: 'get'})},
	//添加项目
	addProject:(data) => {return request({url: '/admin/project/add',method: 'post',data: data})},
	//更新项目
	editProject:(data) => {return request({url: '/admin/project/update',method: 'put',data: data})},
	//删除项目
	delProject:(id) => {return request({url: `/admin/project/${id}`,method: 'delete'})},
    //dc项目详情
    getDCProjectDetail:(id) => {return request({url: `/dc/project/details/${id}`,method: 'get'})},

	//用户列表
	getUserAuth:(params) => {return request({url: `${process.env.VUE_APP_ZDB_URL}/eep/sys/project/getLogonUserAuths`,method: 'get',params: params})},
	getUserInfo:(params) => {return request({url: `${process.env.VUE_APP_ZDB_URL}/eep/sys/getLogonAcct`,method: 'get',params: params})},
	getImageUrl:(params) => {return request({url: `${process.env.VUE_APP_ZDB_URL}/eep/poa/ui/system/getLogonUserAuths`,method: 'get',params: params})},
	downImage:(id) => {return request({url: `${process.env.VUE_APP_ZDB_URL}/eep/doc/getFileBase64?id=${id}&big=1`,method: 'get'})},

	//项目质量安全统计
  getQualIndexTopCounts:(params) => {return request({url: `${process.env.VUE_APP_ZDB_URL}/eep/qual/getQualIndexTopCounts`,method: 'get',params: params})},
  getSafeIndexTopCounts:(params) => {return request({url: `${process.env.VUE_APP_ZDB_URL}/eep/safe/getSafeIndexTopCounts`,method: 'get',params: params})},

	//用户列表
	getUserList:(data) => {return request({url: '/admin/user/page',method: 'post',data: data})},
	//添加用户
	addUser:(data) => {return request({url: '/admin/user',method: 'post',data: data})},
	//更新用户
	editUser:(data) => {return request({url: '/admin/user',method: 'put',data: data})},
	//删除
	delUser:(id) => {return request({url: `/admin/user/${id}`,method: 'delete'})},
	//冻结用户
	lockUser:(data) => {return request({url: '/admin/user/lock',method: 'post',data: data})},

	//菜单列表
	getMenuList:(params) => {return request({url: '/admin/menu/tree',method: 'get',params: params})},
	//岗位列表
	getRoleList:(data) => {return request({url: '/admin/role/page',method: 'post',data: data})},
	//岗位权限
	getRoleMenu:(id) => {return request({url: `/admin/menu/tree/${id}`,method: 'get'})},
	//添加岗位
	addRole:(data) => {return request({url: '/admin/role',method: 'post',data: data})},
	//设置岗位
	setRole:(data) => {return request({url: '/admin/role/menu',method: 'put',data: data})},
	//删除岗位
	delRole:(id) => {return request({url: `/admin/role/${id}`,method: 'delete'})},
	//冻结岗位
	lockRole:(data) => {return request({url: '/admin/role/lock',method: 'post',data: data})},

	//考勤统计
	getAttendanceTotal:(data) => {return request({url: '/dc/attendance/business_list',method: 'post',data: data})},
	//时段出勤统计
	getAttendanceTime:(data) => {return request({url: '/dc/attendance/latestattendance',method: 'post',data: data})},
	//工种统计
	getWorkerTotal:(data) => {return request({url: '/dc/attendance/worktypelist',method: 'post',data: data})},
	// 质量安全统计
	qualitySafetyTotal:(data) => {return request({url: '/dc/info/qualityAndSafeExamine',method: 'post',data: data})},
	// 质量安全趋势
	qualitySafetyTrend:(data) => {return request({url: '/dc/info/qualityAndSafeTrend',method: 'post',data: data})},
	// 质量安全分析
	qualitySafetyAnalyze:(data) => {return request({url: '/dc/info/qualityAndSafeWarning',method: 'post',data: data})},

	// 人员类型统计
	getPersonTotal:(data) => {return request({url: '/dc/attendance/project_list',method: 'post',data: data})},
	// 劳务分包单位
	getPersonDept:(data) => {return request({url: '/dc/attendance/orglist',method: 'post',data: data})},
	// 异常人员分析
	getPersonAbsence:(data) => {return request({url: '/dc/attendance/exceptionlist',method: 'post',data: data})},
	// 人员实时动态
	getPersonActive:(data) => {return request({url: '/dc/attendance/workerlist',method: 'post',data: data})},
	// 班组人员统计
	getPersonTeam:(data) => {return request({url: '/dc/attendance/teamlist',method: 'post',data: data})},

	// 当日用水量
	getWaterTotal:(data) => {return request({url: '/dc/water/title_cost',method: 'post',data: data})},
	// 当日用电量
	getElectricTotal:(data) => {return request({url: '/dc/electric/title_cost',method: 'post',data: data})},
	// 用水区域
	getWaterArea:(data) => {return request({url: '/dc/water/daycostbyarea',method: 'post',data: data})},
	// 用电区域
	getElectricArea:(data) => {return request({url: '/dc/electric/daycostbyarea',method: 'post',data: data})},
	// 水表在线率
	getWaterOnline:(data) => {return request({url: '/dc/water/projectdevicelist',method: 'post',data: data})},
	// 电表在线率
	getElectricOnline:(data) => {return request({url: '/dc/electric/projectdevicelist',method: 'post',data: data})},
	// 水表用趋势
	getWaterTrend:(data) => {return request({url: '/dc/water/daycostbyname',method: 'post',data: data})},
	// 电表用趋势
	getElectricTrend:(data) => {return request({url: '/dc/electric/daycostbyname',method: 'post',data: data})},
	// 水表能耗
	getWaterConsume:(data) => {return request({url: '/dc/water/historycost',method: 'post',data: data})},
	// 电表能耗
	getElectricConsume:(data) => {return request({url: '/dc/electric/historycost',method: 'post',data: data})},
    //获取萤石云token
    getEZopenToken(data){return request({url:'/dc/open/getystoken', method: 'post', data:data})},
    // 萤石云-开始云台控制
    getPtzStart(params){return request({url:'/lapp/device/ptz/start', method: 'post', params:params,headers:{"Host":"https://open.ys7.com/api"}})},
    // 萤石云-结束云台控制
    getPtzStop(params){return request({url:'/lapp/device/ptz/stop', method: 'post', params:params,headers:{"Host":"https://open.ys7.com/api"}})}
}